<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/jsps/common/taglibs.jsp"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>购买基金</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	
	<link rel="stylesheet" type="text/css" href='<c:url value="/css/application.css"/>'>
	<link rel="stylesheet" type="text/css" href='<c:url value="/css/list.css"/>'>
	<link rel="stylesheet" type="text/css" href='<c:url value="/css/form.css"/>'>

	<script type="text/javascript">
		function back(){
			location.href = 'fundMgr?act=show';
		}
		
		function validateFrm(){
			with(document.forms[0]){
				if(buy_num.value == ''){
					alert("购买数量不能为空！");
					buy_num.focus();
					return false;
				}
			}
			return true;
		}
	</script>
<style type="text/css">
	body {
			background:url(pics/bg.jpg);
			-webkit-background-size: cover;
			-moz-background-size: cover;
			background-size: cover;
		}
</style>
  </head>
  
  <body>
    <div id="wrapper">
		<div id="f_title">购买基金</div>
		<form action="<c:url value="/fundMgr?act=buy"/>" method="post" onSubmit = "return validateFrm();">
			<input type = "hidden" name="fund_no" value="${fund.fundNo}">
			<input type = "hidden" name="account_no" value="${account.accountNo}">
			<div class="f_row">
				<span style="color='red'">[注：购买基金需要缴纳总交易数额5%的手续费]</span>
			</div>
			<div class="f_row">
				<span>账户编号：</span><span>${account.accountNo}</span>
			</div>
			<div class="f_row">
				<span>账户余额：</span><span>${account.accountAmount}</span>
			</div>
			<div class="f_row">
				<span>基金编号：</span><span>${fund.fundNo}</span>
			</div>
			<div class="f_row">
				<span>基金名称：</span><span>${fund.fundName}</span>
			</div>
			<div class="f_row">
				<span>基金单价：</span><span>${fund.fundPrice}</span>
			</div>
			<div class="f_row">
				<span>购买数量：</span><input type = "text" name="buy_num" value="${ buy_num}">
			</div>
			<div class="f_row">
				<input type="submit" value="购买" style="height=25px;width=50px">&nbsp;&nbsp;&nbsp;
				<button style="height=25px;width=50px" onclick="back();">返回</button>
			</div>
		</form>
	</div>

	<c:if test="${not empty err}">
		<script type="text/javascript">
			alert('${err}');
		</script>
	</c:if>
  </body>
</html>
